import axios from 'axios'

// axios.defaults.baseURL =  'http://222.20.82.198:9090';
//  axios.defaults.baseURL =  'http://192.168.1.7:9000'; //涂俊
  // axios.defaults.baseURL =  'http://192.168.1.4:9000'; // 胡璇伊
  axios.defaults.baseURL =  'http://192.168.1.32:9000'; // 服务
// sessionStorage.setItem('baseUrl','http://222.20.82.198:9090');
// sessionStorage.setItem('baseUrl','http://222.20.82.198:9090');
//服务器
// axios.defaults.baseURL =  'http://192.168.1.32:9000';

let timeout = {timeout: 15000};

//服务
export const prefix ='http://192.168.1.32:9000/';
// export const prefix ='http://192.168.1.4:9000/';


//用户注册
export const register = params => {return axios.post('/user/register',params,timeout)};
//export const upload = params => {return axios.post('/user/register',params,timeout)};

//机构注册
export const institutionregister = params => {return axios.post('/institution/register',params,timeout)};

//登录
export const login = params => {return axios.post('/user/login',params,timeout)};

//大文件上传
// export const uploadStart = params => {return axios.post('/file/fileupload',params,timeout)};

//普通文件上传
export const pictureupload = (params) => {return axios({url:'/pvd/upload',method:'post', data:params,ContentType:'multipart/form-data'})};
//栅格上传
export const picturexmlupload = (params) => {return axios({url:'/rasterImage/upload',method:'post', data:params,ContentType:'multipart/form-data'})};



// export const addFile = params => {return axios.post('/pvd/upload',params,timeout)};

//文件检索
export const search = params => {return axios.post('/search/query',params,timeout)};

//数据展示
export const getsearchData = params => {return axios.post('/search/content',params,timeout)};
// export const downloadById = params => {return axios.get('/download/ById',params)};
// export const downloadByZip = params => {return axios.get('/download/zip',params)};
export const getMap = params => {return axios.post('/pvd/getMap',params,timeout)};
export const getTiles = params => {return axios.post('/pvd/getTiles',params,timeout)};

//sysm 数据服务,按专题浏览文件
export const gettopicsearchData = params => {return axios.post('/search/topic',params,timeout)};
//数据服务,按专题浏览文件-查看文件详情
export const gettopicdetailData = params => {return axios.get('/search/detail',{params},timeout)};
//数据服务,按专题浏览文件-单个下载文件
export const gettopicuploadData = params => {return axios.get('/download/ById',{params},timeout)};
// 首页热门文件
export const getTopFiles = params => {return axios.get('/total/top',{params},timeout)};
//数据服务,按专题浏览文件-删除
export const gettopicdelData = params => {return axios.delete('/delete/byId',{params},timeout)};

// 首页数据概况
export const getAllFileSize = params => {return axios.get('/total/all',{params},timeout)};
export const getAllSize = params => {return axios.get('/total/upload',{params},timeout)};
// 统计主题词数量
export const getTopicNum = params => {return axios.get('/total/topic',{params},timeout)};

// 统计主题词数量
export const getTheme = params => {return axios.get('/total/theme',{params},timeout)};

//历史上传文件
export const historyuploadData = params => {return axios.get('/self/file',{params},timeout)};


//下面开始是形态管控专题接口
//岸线轮廓提取

//export const getContour = params => {return axios.post('/contour/getContour',params,timeout)}; posturl传值方式
export const getContour = params => {return axios.post('/contour/getContour?filename='+params ,{},timeout)};

//查询提取图片

export const getContourPic = params => {return axios.get('/contour/getContourResult',{params},timeout)};

//形态指标计算
export const getAnalysis = params => {return axios.get('/contour/getAnalysisResult',{params},timeout)};

//下面开始是地物分类专题接口
//获取地物分类结果图像
export const getPreview = params => {return axios.get('/classify/getClassifiedGround', {params}, timeout)};






